package com.hnisc.service.impl;

import com.hnisc.dao.FlightDao;
import com.hnisc.entity.Flighht;
import com.hnisc.service.FlightService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 航班信息service实现类
 */
@Service("flightService")
public class FlightServiceImpl implements FlightService {
    @Autowired
    private FlightDao flightDao;

    @Override
    public Integer getFlightNo(String flightNo) {
        System.out.println("业务层：根据航班编号查询航班记录数");
        return flightDao.getFlightNo(flightNo);
    }

    @Override
    public Integer getAdd(Flighht flighht) {
        System.out.println("业务层：添加航班信息");
        return flightDao.getAdd(flighht);
    }

    @Override
    public List<Flighht> getCity(Integer departureCity, Integer arrivalCity) {
        System.out.println("业务层：根据起飞城市id和到达城市id查询");
        return flightDao.getCity(departureCity,arrivalCity);
    }
}
